<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 引入样式 -->
    <link
      rel="stylesheet"
      href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"
    />
  </head>
  <body>
    <div id="app">
      <h1>游戏介绍-刺客信条</h1>
      <p>
        <router-link to="/basicInfo">基本信息</router-link>
        <router-link to="/personInfo">人物信息</router-link>
        <router-link to="/acceiveInfo">获得成就</router-link>
      </p>
      <!-- 路由出口 -->
      <router-view></router-view>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script>
      //1. 定义组件模板
      const basicInfo = {
        template:
          '<div>《刺客信条》是由育碧蒙特利尔工作室研发的动作冒险类游戏系列</div>',
      }
      const personInfo = { template: '<div>艾吉奥，二大爷</div>' }
      const acceiveInfo = { template: '<div>年度最佳提名</div>' }
      //2. 定义路由列表
      const routes = [
        { path: '/basicInfo', component: basicInfo },
        { path: '/personInfo', component: personInfo },
        { path: '/acceiveInfo', component: acceiveInfo },
      ]

      //3. 创建路由对象
      const router = new VueRouter({
        routes: routes,
      })
      //4. 挂载路由对象到vue中
      new Vue({
        el: '#app',
        router: router,
      })
    </script>
  </body>
</html>
